<?php
$loader->requireOnce('includes/RadProcessor/XRayProcessor.class.php');
$loader->requireOnce('includes/RadProcessor/EndoscopyProcessor.class.php');
$loader->requireOnce('includes/RadProcessor/UltrasoundProcessor.class.php');
$loader->requireOnce('includes/RadException.class.php');
class RadProcessorFactory{

    public function createProcessor($enumRadType) {
        switch($enumRadType) {
        	case Utils::getEnumKey(EnumerationConstant::PARACLINIC_TYPE, EnumerationConstant::PARACLINIC_XRAY):
                return new XRayProcessor($enumRadType);
            case Utils::getEnumKey(EnumerationConstant::PARACLINIC_TYPE, EnumerationConstant::PARACLINIC_ENDO):
                return new EndoscopyProcessor($enumRadType);
            case Utils::getEnumKey(EnumerationConstant::PARACLINIC_TYPE, EnumerationConstant::PARACLINIC_ULTRA):
                return new UltrasoundProcessor($enumRadType);
            default:
            	throw new RadException('Type='. $enumRadType . ' is currently not supported', RadErrorCode::TYPE_NOT_SUPPORTED);
            	break;

        }
    }
}
?>